from django.contrib.sitemaps import Sitemap
from cmsdj.categories.models import Category
from django.utils.datetime_safe import datetime
from cmsdj.content.models import Content

class SitemapCategorias(Sitemap):
    changefreq = "never"
    priority = 0.5

    def items(self):
        return Category.all_cats()
    
class SitemapContenidos(Sitemap):
    priority = 0.5

    def items(self):
        return Content.get_by_date_created()

    def lastmod(self, obj):
        return obj.modified